Communication apparatus, terminal apparatus, control methods thereof, and non-transitory computer-readable storage medium

ABSTRACT

According to the present invention, when a terminal apparatus is brought close to a printing apparatus serving as a processing apparatus, the terminal apparatus uses its own NFC unit to acquire, from the printing apparatus, information for communicating with each of one or more network connection units provided in the printing apparatus. Then, using a communication unit, the terminal apparatus then searches for the printing apparatus on a network in accordance with the acquired information. In the case where the terminal apparatus has successfully identified the printing apparatus as being present on the network, the terminal apparatus transmits a processing request to the printing apparatus successfully identified on the network via the communication unit.

This application is a continuation of application Ser. No. 15/787,058filed Oct. 18, 2017, which is a continuation of application Ser. No.15/496,087 filed Apr. 25, 2017, U.S. Pat. No. 9,836,260 B2, which is acontinuation of application Ser. No. 15/014,230 filed Feb. 3, 2016, U.S.Pat. No. 9,674,378 B2, which is a division of application Ser. No.14/747,375 filed Jun. 23, 2015, U.S. Pat. No. 9,565,320 B2.

BACKGROUND OF THE INVENTION Field of the Invention

The present invention relates to communication apparatuses, terminalapparatuses, control methods thereof, and a non-transitorycomputer-readable storage medium.

Description of the Related Art

It has recently become possible for printers to receive images fromexternal devices such as digital cameras, cellular phones, and the likeand print those images by communicating wirelessly with such externaldevices. In such cases, the printer and the external device initiallyidentify their respective communication partners through a shortdistance wireless communication technique as exemplified by NFC (NearField Communication). A technique is also known where the printer thenreceives an image file to be printed from the external device using adifferent wireless communication technique that is faster than shortdistance wireless communication.

Meanwhile, with a printer provided with multiple interfaces such aswired LAN and wireless LAN, a user can print using one of theinterfaces. In a conventional printer, even if multiple interfaces areprovided, it is typical for communication to be carried out using onlyone of the interfaces.

Recently, a method in which NFC is used to connect a terminal apparatusand an external device to a common access point and ensure that anInternet connection is not cut off has been proposed. Japanese PatentLaid-Open No. 2011-182449 is known as a document that discloses such amethod.

Although this document is useful in the case where both the terminal andthe apparatus are on the same network and can therefore connect to eachother, there is a problem in that when such is not the case, theterminal cannot easily make processing requests (for printing, forexample).

SUMMARY OF THE INVENTION

Having been achieved in light of the aforementioned problems, thepresent invention provides a technique that makes it possible, through asimple operation, to specify a network being used from among a pluralityof network connection units provided in a processing apparatus andtransmit a processing request from a terminal apparatus to theprocessing apparatus.

According to a first aspect of the present invention, there is provideda communication apparatus capable of executing short distance wirelesscommunication, the apparatus comprising: a first interface used whencarrying out communication at a higher speed than the short distancewireless communication; a second interface used when carrying outcommunication at a higher speed than the short distance wirelesscommunication; a receiving unit that receives a selection instructionfor an interface to be activated; a writing unit that writes networkinformation corresponding to the interface, of the first and secondinterfaces, that has been activated by the selection instruction intoshort distance wireless communication information transmitted throughthe short distance wireless communication; and a transmitting unit thattransmits the short distance wireless communication information to acommunication partner apparatus through the short distance wirelesscommunication.

According to a second aspect of the present invention, there is provideda communication apparatus capable of communicating with a communicationpartner apparatus, the communication apparatus comprising: a firstchanging unit that changes a connection method from a connection methodusing an external access point to a method for making a peer-to-peerconnection with the communication partner apparatus; and a secondchanging unit that, in the case where a predetermined condition has beenmet after the connection method has been changed, changes from thepeer-to-peer connection to a connection using the external access point.

According to a third aspect of the present invention, there is provideda control method for a communication apparatus including a firstinterface used when carrying out communication at a higher speed thanshort distance wireless communication and a second interface used whencarrying out communication at a higher speed than the short distancewireless communication, the method comprising: a receiving step ofreceiving a selection instruction for an interface to be activated; awriting step of writing network information corresponding to theinterface, of the first and second interfaces, that has been activatedby the selection instruction into short distance wireless communicationinformation transmitted through the short distance wirelesscommunication; and a transmitting step of transmitting the shortdistance wireless communication information to a communication partnerapparatus through the short distance wireless communication.

According to a fourth aspect of the present invention, there is provideda control method for a communication apparatus capable of communicatingwith a communication partner apparatus, the method comprising: a firstchanging step of changing a connection method from a connection methodusing an external access point to a method for making a peer-to-peerconnection with the communication partner apparatus; and a secondchanging step of changing, in the case where a predetermined conditionhas been met after the connection method has been changed, from thepeer-to-peer connection to a connection using the external access point.

According to a fifth aspect of the present invention, there is provideda non-transitory computer-readable storage medium storing a computerprogram causing a computer to execute each step of the method in thethird aspect of the invention.

According to a sixth aspect of the present invention, there is provideda non-transitory computer-readable storage medium storing a computerprogram causing a computer to execute each step of the method in thefourth aspect of the invention.

According to the present invention, it is possible, through a simpleoperation of bringing a terminal apparatus close to a processingapparatus, to specify a network being used from among a plurality ofnetwork connection units provided in the processing apparatus andtransmit a processing request from the terminal apparatus to theprocessing apparatus.

Further features of the present invention will become apparent from thefollowing description of exemplary embodiments (with reference to theattached drawings).

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a diagram illustrating the configuration of a printing systemaccording to an embodiment.

FIG. 2 is a diagram illustrating the external appearance of a terminalapparatus.

FIGS. 3A and 3B are diagrams illustrating the external appearance of aprinting apparatus.

FIG. 4 is a block diagram illustrating the configuration of a terminalapparatus.

FIG. 5 is a block diagram illustrating the configuration of a printingapparatus.

FIG. 6 is a block diagram illustrating the configuration of an NFC unit.

FIG. 7 is a diagram illustrating the structure of NDEF data saved in anNFC unit.

FIG. 8 is a flowchart illustrating processing performed by a terminalapparatus.

FIG. 9 is a flowchart illustrating processing performed by a printingapparatus.

FIG. 10 is a flowchart illustrating processing performed by a terminalapparatus according to a second embodiment.

FIGS. 11A and 11B are flowcharts illustrating processing performed by aprinting apparatus according to a fourth embodiment.

DESCRIPTION OF THE EMBODIMENTS

Hereinafter, exemplary embodiments of the present invention will bedescribed in detail with reference to the drawings. Note that unlessotherwise specified, the scope of this invention is not intended to belimited only to the relative arrangements of the constituent elements,screens that are displayed, and so on described in the embodiments.

System Configuration

FIG. 1 is a diagram illustrating the configuration of a networkprocessing system according to an embodiment. This system is builtaround a network 100, and is constituted by a mobile-type terminalapparatus 200 capable of connected to the network 100 and a printingapparatus 300, serving as a processing apparatus, that carries outprocessing in response to requests from the terminal apparatus 200. Theterminal apparatus 200, which functions as a communication apparatus,includes at least two wireless communication units having differentcommunication speeds (or communication ranges). The terminal apparatus200 may be any type of apparatus that can handle files to be printed,including personal information terminals such as PDAs (Personal DigitalAssistants), smartphones and cellular phones, digital cameras, and soon.

The printing apparatus 300 that functions as the communication apparatusincludes a reading function for optically reading a document placed onan original platform and a printing function for printing using a printengine such as an ink jet printer, and may also include a fax function,a telephony function, and so on.

The network 100 and the printing apparatus 300 are connected over awired LAN or a wireless LAN. The network 100 and the terminal apparatus200 are connected over a wireless LAN. The terminal apparatus 200 andthe printing apparatus 300 are both capable of communicating throughshort distance wireless communication. Furthermore, because the terminalapparatus 200 and the printing apparatus 300 both have wireless LANfunctions, these apparatuses are capable of peer-to-peer (“P2P”hereinafter) communication through mutual authentication.

FIG. 2 is a diagram illustrating an external view of the terminalapparatus 200. A smartphone is illustrated as an example in the presentembodiment. “Smartphone” refers to a multiple-function cellular phonethat includes a camera, an Internet browser, an email function, and soon in addition to cellular phone functionality.

An NFC (Near Field Communication) unit 201 is a unit that carries outshort distance wireless communication. The NFC unit 201 can carry outcommunication by actually bringing the NFC unit 201 to within apredetermined distance (approximately 10 cm) from the NFC unit of apartner device (an NFC unit of the printing apparatus 300, in thisembodiment).

A wireless LAN unit 202 is a unit for communicating over the wirelessLAN, which is faster than the NFC communication, and is provided withinthe terminal apparatus 200. A display unit 203 is a display having anLCD-type display mechanism, for example. An operating unit 204 has atouch panel-type operating mechanism, and detects information indicatingtouches made by a user. In this case, a typical operating methodinvolves displaying button icons, a software keyboard, and so on in thedisplay unit 203, with events being issued when the user presses abutton by touching the operating unit 204. A power key 205 is used whenturning the power on and off.

FIGS. 3A and 3B are diagrams illustrating an external view of theprinting apparatus 300. A Multi Function Printer (MFP) having a readingfunction (a scanner) is illustrated as an example in the presentembodiment. As illustrated in FIG. 3A, an original platform 301 is atransparent platform made of glass, and is used for placing a documentand reading the document with the scanner. An original cover plate 302is a cover for ensuring that reading light does not escape to theexterior when reading a document using the scanner. A print paperinsertion port 303 is an insertion port for setting various sizes ofpaper. Paper set in the print paper insertion port 303 is transportedone sheet at a time to a printing unit, where the paper is printed ontoand then discharged from a print paper discharge port 304.

FIG. 3B is a top view of the original cover plate 302. An operationpanel console unit 305 and an NFC unit 306 are disposed on an upperportion of the original cover plate 302. The NFC unit 306 is a unit forcarrying out short distance wireless communication, and corresponds to alocation where the terminal apparatus 200 is actually brought close tothe printing apparatus 300. A predetermined distance (approximately 10cm) from the NFC unit 306 is an active distance for a connection. Awireless LAN antenna 307 is an embedded antenna for communication over awireless LAN.

Note that “short distance wireless communication” refers to wirelesscommunication in which the communication range is a comparatively smallpredetermined range (one meter to several centimeters, for example), asexemplified by NFC.

FIG. 4 is a block diagram illustrating the terminal apparatus 200. Theterminal apparatus 200 includes a main board 210 that controls theapparatus as a whole, the wireless LAN unit 202, the NFC unit 201, aline connection unit 206, the display unit 203, and the operating unit204. Here, the wireless LAN unit 202, the NFC unit 201, the lineconnection unit 206, and a wired LAN unit 309 all function ascommunication units of the terminal apparatus 200.

A microprocessor-type CPU 211 disposed on the main board 210 executesprocesses in accordance with a control program stored in a ROM-typeprogram memory 213 and data in a RAM-type data memory 214, which areconnected to the CPU 211 via an internal bus 212.

The CPU 211 communicates with another communication terminal apparatusover a wireless LAN 102 by controlling the wireless LAN unit 202 via awireless LAN controller 215. The CPU 211 detects a connection withanother NFC terminal over NFC 101, exchanges data with the other NFCterminal, and so on by controlling the NFC unit 201 via an NFCcontroller 216. The CPU 211 can connect to a cellular phone network 105and carry voice conversations, exchange data, and so on by controllingthe line connection unit 206 via a line controller 217.

The CPU 211 can receive instructions from the user via the operatingunit 204, display various types of menus, images, and the like in thedisplay unit 203, and so on by controlling an operation panel controller218. The CPU 211 can shoot images by controlling a camera unit 219, andstores shot images in an image memory 220 within the data memory 214. Inaddition to shot images, images acquired from the exterior via thecellular phone network 105, the wireless LAN 102, or NFC 101 can bestored in the image memory 220 or, conversely, transmitted to theexterior.

A non-volatile memory 221 is constituted by a memory such as flashmemory, and holds data to be retained even when the power has beenturned off. For example, in addition to telephone contact data, varioustypes of communication connection information, and information ofdevices connected to in the past, image data to be retained, programssuch as application software that realizes various types of functions inthe terminal apparatus 200, and so on are stored as well.

FIG. 5 is a block diagram illustrating the configuration of the printingapparatus 300. The printing apparatus 300 includes a main board 310 thatcontrols the apparatus as a whole, a line connection unit 322, awireless LAN unit 308, the NFC unit 306, the wired LAN unit 309, and anoperation panel 305. Here, the line connection unit 322, the wirelessLAN unit 308, the NFC unit 306, and the wired LAN unit 309 all functionas communication units of the printing apparatus 300. Note that thewireless LAN is capable of faster communication than the NFC unit, andthe wired LAN is capable of even faster communication.

A microprocessor-type CPU 311 disposed on the main board 310 executesprocesses in accordance with a control program stored in a ROM-typeprogram memory 313 and data in a RAM-type data memory 314, which areconnected to the CPU 311 via an internal bus 312.

The CPU 311 reads a document by controlling a scanner unit 315, andstores read image data in an image memory 316 within the data memory314. The CPU 311 can also print images in the image memory 316 withinthe data memory 314 onto a recording medium by controlling a printingunit 317.

The CPU 311 communicates with another communication terminal apparatusover the wireless LAN 102 by controlling the wireless LAN unit 308 via awireless LAN controller 318. The CPU 311 also communicates with anothercommunication terminal apparatus over a wired LAN 103 by controlling thewired LAN unit 309 via a wired LAN controller 329. The CPU 311 candetect a connection with another NFC terminal over NFC 101, exchangedata with the other NFC terminal, and so on by controlling the NFC unit306 via an NFC controller 319. The CPU 311 can connect to a telephonenetwork 323 and exchange faxes, data, and so on by controlling the lineconnection unit 322 via a line controller 321.

The CPU 311 can display a status of the printing apparatus 300, functionselection menus, and so on in the operation panel 305, accept operationsmade by the user, and so on by controlling an operation panel controller320. As such, the operation panel 305 is constituted by various types ofswitches and buttons as well as a touch panel-equipped display.

FIG. 6 is a block diagram illustrating, in detail, an NFC unit 600 usedas the NFC unit 201 in the terminal apparatus 200 or as the NFC unit 306in the printing apparatus 300.

In short distance wireless communication (NFC communication) performedby the NFC unit 600, an apparatus that outputs an RF (Radio Frequency)field and starts communication is called an “initiator”. Meanwhile, anapparatus that carries out communication with the initiator in responseto a command issued by the initiator is called a “target”. The NFC unithas a passive mode and an active mode as communication modes.

In the passive mode, the target responds to a command from the initiatorthrough load modulation. Accordingly, it is not necessary to supplypower to the target. On the other hand, in the active mode, the targetresponds to a command from the initiator using an RF field emitted bythe target itself. Accordingly, it is necessary to supply power to thetarget. The active mode has a characteristic of being capable of fastercommunication speeds than the passive mode.

The descriptions will now return to FIG. 6. An NFC controller unit 601,an antenna unit 602, an RF unit 603, a transmission/reception controlunit 604, an NFC memory 605, a power source 606, and a device connectionunit 607 are present in the NFC unit 600. The antenna unit 602 receivesradio waves, carriers, and the like from other NFC devices, transmitsradio waves, carriers, and so on to other NFC devices, and the like. TheRF unit 603 has a function for modulating/demodulating analog signalsinto/from digital signal. The RF unit 603 has a synthesizer, identifiesbands and channel frequencies, and carries out band and channel controlthrough data by allocating frequencies.

Note that the NFC memory 605 is constituted by a non-volatile memorythat can be read and written to. Even when power is not being suppliedfrom the power source 606, data stored in the NFC memory 605 can be readand written as long as induced electromotive force is produced in thepassive mode. Data storage control, including the reading and writing ofdata in the NFC memory 605, is realized by the NFC controller unit 601.Note that “when power is not being supplied from the power source 606”refers to a state in which a battery of the terminal apparatus 200 hasbeen exhausted and power is not being supplied to the printing apparatus300.

The transmission/reception control unit 604 carries out controlregarding transmission and reception, including the assembly anddisassembly of transmitted/received frames, preamble addition anddetection, frame identification, and so on. The transmission/receptioncontrol unit 604 also controls the NFC memory 605, and reads and writesvarious types of data, programs, and the like. Thetransmission/reception control unit 604 receives a supply of power viathe power source 606 when operating in the active mode. Thetransmission/reception control unit 604 communicates with devices (theCPU 211 of the terminal apparatus 200, the CPU 311 of the printingapparatus 300, and so on) through the device connection unit 607,communicates with other NFC devices within a communication range throughcarriers exchanged via the antenna unit 602, and so on. When operatingin the passive mode, the transmission/reception control unit 604receives a carrier from another NFC device via the antenna unit 602,receives a supply of power from the other NFC device throughelectromagnetic induction, communicates with the other NFC device bymodulating the carrier, and exchanges data. Hereinafter, an action ofbringing the (NFC unit 201 of the) terminal apparatus 200 toward the(NFC unit 306 of the) printing apparatus 300 will be referred to as an“NFC touching action”.

First Embodiment

The present first embodiment describes a use case in which a userselects an image to be printed by operating the terminal apparatus 200and prints the selected image using the printing apparatus 300 bycarrying out an NFC touching action by touching the terminal apparatus200 to the printing apparatus 300 that is to carry out the print withthe image remaining in a selected state.

FIG. 8 is a flowchart illustrating processing carried out when an imagespecified using the terminal apparatus 200 is printed by the printingapparatus 300. Note that in the present application, flowcharts executedby the terminal apparatus 200 are realized by the CPU 211 of theterminal apparatus 200 reading out programs related to the flowchart andexecuting those programs. Meanwhile, processing steps in the flowchartsof the present application may be omitted as necessary.

First, the user selects image data stored in the image memory 220through an operation made using the operating unit 204. A single or aplurality of pieces of image data may be selected here.

The user then performs an action for bringing the terminal apparatus200, with the image in a selected state, toward the NFC unit 306 of theprinting apparatus 300 that will be requested to carry out theprocessing (the NFC touching action). The terminal apparatus 200 and theprinting apparatus 300 transition to an NFC communication mode as aresult. Note that the transition to the NFC communication mode may berealized, for example, by the user making a setting in the operationpanel of the printing apparatus 300, or may be realized automaticallythrough the NFC touching action.

In step S802, the terminal apparatus 200 receives, from the NFC unit 306of the printing apparatus 300, an NDEF message in the NFC memory 605within that NFC unit 306.

The structure of NDEF data saved in the NFC unit will be described usingFIG. 7. In the NDEF data, a RecordType indicating what the NDEF messageis held in a first NDEF “Record1” that constitutes a header portion.Specifically, “Hq (HandoverRequest)”, indicating a handover requestmessage, “Hs (HandoverSelect)”, indicating a message responding to therequest, or the like is written in the Record Type. Note that becausethe NDEF data is transmitted to the communication partner apparatusthrough short distance wireless communication, the NDEF data is alsosometimes called “short distance wireless communication information”.

“Record2” is constituted by a RecordType containing details indicatingthat the packet in question is A service configuration information, anda Payload portion containing detailed network configuration information.Parameters regarding respective communication methods are held in thenetwork information. Specifically, for two network interface units (ornetwork interface cards (NICs)) in the printing apparatus 300,information of a first MAC address of a first unit and a second MACaddress of a second unit is held in the network information. Forexample, a wired LAN MAC address and a wireless LAN MAC address are heldin the network information. Through this, the terminal apparatus 200 canacquire the MAC address information of the physical interfaces in theprinting apparatus 300 from the NDEF message. Although the presentapplication describes an example in which the printing apparatus 300 hastwo network interface units, the number thereof is not particularlylimited as long as the number is 1 or more.

Furthermore, peer-to-peer connection information (“peer-to-peer” will beabbreviated as “P2P” hereinafter) is held in the Payload portion.Specifically, information required for a P2P connection such as WiFidirect, including an SSID, encryption method, authentication method,network key, and the like, is held in this portion.

Generally speaking, the terminal apparatus 200 and the printingapparatus 300 cannot carry out data communication unless connected tothe same access point. To circumvent this, the terminal apparatus 200changes the wireless network configuration on the terminal apparatus 200side using the P2P information acquired from the NDEF message receivedfrom the printing apparatus 300. Doing so enables the terminal apparatus200 and the printing apparatus 300 to establish peer-to-peercommunication and carry out data communication.

After receiving the NDEF message, in step S803, the terminal apparatus200 determines whether a mode transition command for standing by fordata reception from the terminal apparatus 200 has been issued to theprinting apparatus 300. Information indicating whether or not thecommand has been issued is stored in the data memory 214 of the terminalapparatus 200. In the case where the mode transition command has notbeen issued, in step S804, whether the first MAC address in the NDEFmessage is present on the same network as the terminal apparatus 200 isconfirmed (searched). In the case where the first MAC address is presenton the same network, the terminal apparatus 200 can recognize an IPaddress of the printing apparatus 300 (step S805). For example, ICMP,MulticastDNS, or the like is used to recognize the IP address. Then, instep S806, the terminal apparatus 200 issues the mode transition commandfor standing by for data reception to the printing apparatus 300.

On the other hand, in the case where the first MAC address cannot bedetected on the same network, in step S810, the terminal apparatus 200confirms whether the second MAC address is present on the same networkas the terminal apparatus 200. In the case where the second MAC addresscannot be detected, in step S811, the terminal apparatus 200 refers tothe P2P information held in the NDEF message acquired from the NFC unit201 of the printing apparatus 300 and determines whether thecommunication mode of the terminal apparatus 200 is the same as thewireless LAN configuration in the P2P information. For example, thedetermination is carried out by the terminal apparatus 200 comparing theSSID of an access point provided in the printing apparatus 300 with theSSID set in the terminal apparatus 200 and determining whether or notthe SSIDs are the same.

In the case where the communication mode of the terminal apparatus 200does not match the P2P information, the terminal apparatus 200 changesthe communication mode of the terminal apparatus 200 to thecommunication mode of the printing apparatus 300 (step S812). Forexample, the terminal apparatus 200 sets the SSID of the printingapparatus 300.

In this manner, there is a risk that the printing apparatus 300 cannotbe detected in the case where the printing apparatus 300 includes aplurality of interfaces and only the interface information of one of theinterfaces is returned. For example, in the case where the wireless LANMAC address is held in the NDEF message despite the wired LAN being inan active state, the terminal apparatus 200 will search for the wirelessLAN MAC address on the network. As a result, the NFC-touched printingapparatus 300 cannot be searched out even if the terminal apparatus 200and the printing apparatus 300 are on the same network. However,carrying out the above processing makes it possible to correctlyestablish a connection between the terminal apparatus 200 and theprinting apparatus 300.

In step S806, the terminal apparatus 200 issues the mode transitioncommand for standing by for data reception from the terminal apparatus200 to the printing apparatus 300. After the command is issued, in stepS807, the terminal apparatus 200 converts the image data selected by theuser into a format that can be printed by the printing apparatus 300 andtransmits the data to the printing apparatus 300 via the wireless LANunit 202 as print data. Although the terminal apparatus 200 is describedas transmitting the print data to the printing apparatus 300 over thewireless LAN, the printing apparatus 300 does not necessarily receivethe print data from the terminal apparatus 200 over the wireless LAN.This is because the data can also be received over the wired LANconnected to the access point.

After the transmission of all of the print data is complete, in stepS808, the terminal apparatus 200 determines whether to continuetransmitting print data. This determination may be carried out through auser operation, or when no operation is made for a set amount of time.When the printing ends, in step S809, the terminal apparatus 200 issuesa command to cancel the mode for standing by for data reception to theprinting apparatus 300. As a result, the connection between the terminalapparatus 200 and the printing apparatus 300 is canceled.

Next, processing performed by the printing apparatus 300 when printingan image received from the terminal apparatus 200 will be describedusing the flowchart illustrated in FIG. 9. In the present application,flowcharts executed by the printing apparatus 300 are realized by theCPU 311 of the printing apparatus 300 reading out programs related tothe flowchart and executing those programs.

First, the user performs an action for bringing the (NFC unit 201 ofthe) terminal apparatus 200 toward the (NFC unit 306 of the) printingapparatus 300 (the NFC touching action). NFC communication through therespective NFC units is started as a result, and in step S902, theprinting apparatus 300 transfers, to the terminal apparatus 200, theNDEF message held in the NFC memory within the NFC unit 306 of theprinting apparatus.

Upon the NDEF message being transferred to the terminal apparatus 200,in step S903, the printing apparatus 300 determines whether the modetransition command for standing by for data reception from the terminalapparatus 200 has already been received.

If the mode transition command has not been received, in step S904, theprinting apparatus 300 determines whether there is an IP protocol-levelrequest from the terminal apparatus 200. In the case where there is anIP protocol-level request, the terminal apparatus 200 and the printingapparatus 300 can be confirmed as being on the same network, and thusthe printing apparatus 300 stands by to receive the mode transitioncommand for standing by for data reception issued by the terminalapparatus 200.

Then, in step S905, the printing apparatus 300 receives the modetransition command from the terminal apparatus 200. Meanwhile, in thecase where it has been determined in step S904 that there is no IPprotocol-level communication, the printing apparatus 300 stores (saves)the current communication mode of the printing apparatus 300 into thedata memory 314 in step S910. The printing apparatus 300 then changesthe communication mode of the printing apparatus 300 to the P2P modecommunication mode in step S911. Then, as a result of the terminalapparatus 200 executing the processing of S812, the printing apparatus300 and the terminal apparatus 200 can connect on the same network. Forexample, in the case where the printing apparatus 300 is operating in acommunication mode that communicates using an external access point,S911 changes the communication mode to the P2P mode from thecommunication mode that communicates using the access point.

After communication is established, in step S907, the printing apparatus300 receives the print data from the terminal apparatus 200 and printsthe data. However, even in the case where communication is established,the communication mode for printing is returned to the original mode instep S909 in the case where no data is sent from the terminal apparatus200 for a set amount of time in step S906.

After the printing, in step S908, the printing apparatus 300 determineswhether a mode cancel standby command, for canceling the standby fordata reception from the terminal apparatus 200, has been received. Inthe case where the cancel command has been received, if thecommunication mode for printing was changed in step S909, thecommunication mode is returned to the mode used immediately before theprinting using NFC (in other words, the communication mode stored inS910).

A specific example of returning the communication mode will be describedhereinafter. For example, in the case where the wireless LAN of theprinting apparatus 300 is inactive, the wireless LAN inactive state isstored in step S910, the printing is executed in the P2P mode, and afterthe printing ends, the wireless LAN state is canceled and the processingends. In other words, the communication mode of the printing apparatus300 is changed to the wireless LAN inactive state. Meanwhile, in thecase where the wireless LAN of the printing apparatus 300 is active andthe printing apparatus 300 is on the same network as the terminalapparatus, the printing process is carried out through thatcommunication mode, and after the printing ends, in step S909, thecommunication mode remains in that state.

In addition, in the case where one or both of the first and secondinterfaces of the printing apparatus 300 are active and those interfacesare not on the same network as the terminal apparatus, the states of thefirst and second interfaces are stored in step S911. The printing isthen executed in the P2P mode, the states of the first and secondinterfaces are returned to their original states after the printingends, and the processing then ends.

In this manner, according to the present embodiment, the optimalcommunication method can be automatically selected through an NFCtouching action made using the terminal apparatus 200, even without theuser switching the current communication mode. In the case where a modecancel standby command is not sent from the terminal apparatus 200 for aset amount of time in step S908, allowing time to pass in step S912makes it possible to return the communication mode to theimmediately-previous communication mode in the case where the modecancel standby command is not sent for the set amount of time.

A timer is thus used to measure the set amount of time, and the end ofprinting may be used as a trigger for starting the timer; even if thetimer has been started, the timer may be cleared by executing the nextprinting process before the set amount of time has elapsed. In addition,the communication mode may be ended by a main unit operation madethrough the operation panel 305. Doing so makes it possible to executethe print without the user paying attention to the communication mode.

Second Embodiment

The present second embodiment also describes a use case in which theuser selects an image to be printed by operating the terminal apparatus200, after which the image is printed.

The second embodiment differs from the first embodiment in thatinformation indicating an active MAC address is contained in theinterface information acquired through the NFC touching action. In theuse case described below, the user makes the NFC touching action,touching the terminal apparatus 200 to the printing apparatus 300. Theterminal apparatus 200 then acquires the information of the interfacethat is currently active, and the selected image is printed by theprinting apparatus 300 using the MAC address of the active interface.For example, of the wired MAC address and the wireless MAC address, theterminal apparatus 200 can through the NFC touching action acquireinformation indicating the MAC address currently active in the printingapparatus 300.

First, the user selects image data through an operation made using theoperating unit 204. Here, a plurality of pieces of image data may beselected.

The user then performs the NFC touching action for bringing the (NFCunit 201 of the) terminal apparatus 200 toward the (NFC unit 306 of the)printing apparatus 300.

As a result, in step S1002, the terminal apparatus 200 receives an NDEFmessage in the NFC memory 605 within the NFC unit 306 of the printingapparatus 300.

After receiving the NDEF message, in step S1003, the terminal apparatus200 determines whether a mode transition command for standing by fordata reception has been issued to the printing apparatus 300 by theterminal apparatus 200. Information indicating whether or not thecommand has been issued is stored in the data memory 214 of the terminalapparatus 200. In the case where the mode transition command has notbeen issued, in step S1004, the terminal apparatus 200 acquires theinformation of the interface that is currently active, acquired from theNDEF message. S1004 can be realized, for example, by the terminalapparatus 200 acquiring information of the MAC address, among theplurality of MAC addresses contained in the NDEF message, that isactive. Incidentally, an “active state” refers to a state in which theprinting apparatus 300 has established a network connection and canacquire an IP address.

In step S1005, the terminal apparatus 200 confirms whether the MACaddress of the interface in the active state, written in the NDEFmessage, is present on the same network as the terminal apparatus 200.In the case where the MAC address is present on the same network in stepS1006, the terminal apparatus 200 can recognize the IP address of theprinting apparatus 300. In the case where the IP address cannot bedetected, the terminal apparatus 200 carries out steps S1011 and S1012.The processing of S1011 and S1012 is the same as that of S811 and S812,and thus detailed descriptions thereof will be omitted. Likewise, theprocessing of S1007 to S1010 is the same as that of S806 to S809, andthus detailed descriptions thereof will be omitted.

According to the present embodiment, in the case where, for example, adevice search is carried out through broadcasting using a plurality ofMAC addresses, devices searches using the MAC address of an inactiveinterface can be prevented. Accordingly, the present embodiment canlighten the burden of network communication.

Third Embodiment

The above first embodiment describes a case where the MAC address of afirst interface and the MAC address of a second interface stored in theNDEF message are referred to in order. The first interface and thesecond interface may be given a priority order, and information fordetermining which interface to preferentially connect to may be held inthe NDEF message. Whether the MAC address acquired based on the priorityorder in the NDEF message read by the terminal apparatus 200 is on thesame network may then be detected.

Although the embodiments describe the processing apparatus thatcommunicates with the terminal apparatus 200 as the printing apparatus(MFP) 300, the apparatus is not particularly limited to a printingapparatus as long as the apparatus can handle processing requests. Forexample, the apparatus may be a network scanner, network storage, or thelike.

Fourth Embodiment

The present embodiment will use FIGS. 11A and 11B to describe a processin which the printing apparatus 300 overwrites the NDEF information inaccordance with the active interface.

The printing apparatus 300 determines whether or not a selectioninstruction indicating the interface to activate has been received fromthe user through the operation panel 305 (S1101). For example, theprinting apparatus 300 receives an instruction to activate one of thewired LAN and the wireless LAN. Note that the terminal apparatus 200capable of communicating with the printing apparatus 300 may issue aselection instruction for selecting the interface to be activated.Alternatively, an information processing apparatus capable ofcommunicating with the printing apparatus 300 may issue an instructionfor selecting the interface to be activated.

In the case where it is determined in S1101 that the instruction hasbeen received, the printing apparatus 300 writes the MAC addresscorresponding to the interface activated by the user instruction intothe NDEF in the NFC memory 605 of the NFC unit 600 (S1102). FIG. 7indicates the first MAC address of the first unit and the second MACaddress of the second unit, of the two network interface units (or NICs)provided in the printing apparatus 300, as being held in the networkinformation. However, in the present embodiment, the printing apparatus300 writes only the MAC address corresponding to the activated interfacein the network information illustrated in FIG. 7. For example, in thecase where the wired LAN has been activated by the stated instruction,only the MAC address of the wired LAN is written in the networkinformation illustrated in FIG. 7. On the other hand, in the case wherethe activated interface is changed from the wired LAN to the wirelessLAN, the printing apparatus 300 overwrites the MAC address of the wiredLAN with the MAC address of the wireless LAN in the network informationillustrated in FIG. 7.

The printing apparatus 300 determines whether an NFC touching action hasbeen made (S1103). The processing advances to S902 and on in the casewhere it has been determined that the NFC touching action has been made.However, the processing returns to S1101 in the case where the NFCtouching action has not been made. Note that the processing of S902 onis the same as in FIG. 9, and thus detailed descriptions thereof will beomitted.

Through the stated processing, the terminal apparatus 200 can acquirethe MAC address of the interface activated in the printing apparatus300, and thus the correct connection to the printing apparatus 300 canbe made.

Although the present application describes NFC as an example of shortdistance wireless communication, Bluetooth or the like, for example, maybe used as another communication method. Likewise, although the presentapplication describes a printing apparatus, a digital camera, a musicplayer, or the like may be used as an alternative to the printingapparatus.

OTHER EMBODIMENTS

Embodiments of the present invention can also be realized by a computerof a system or apparatus that reads out and executes computer executableinstructions (e. g., one or more programs) recorded on a storage medium(which may also be referred to more fully as a ‘non-transitorycomputer-readable storage medium’) to perform the functions of one ormore of the above-described embodiments and/or that includes one or morecircuits (e. g., application specific integrated circuit (ASIC)) forperforming the functions of one or more of the above-describedembodiments, and by a method performed by the computer of the system orapparatus by, for example, reading out and executing the computerexecutable instructions from the storage medium to perform the functionsof one or more of the above-described embodiments and/or controlling theone or more circuits to perform the functions of one or more of theabove-described embodiments. The computer may comprise one or moreprocessors (e. g., central processing unit (CPU), micro processing unit(MPU)) and may include a network of separate computers or separateprocessors to read out and execute the computer executable instructions.The computer executable instructions may be provided to the computer,for example, from a network or the storage medium. The storage mediummay include, for example, one or more of a hard disk, a random-accessmemory (RAM), a read only memory (ROM), a storage of distributedcomputing systems, an optical disk (such as a compact disc (CD), digitalversatile disc (DVD), or Blu-ray Disc (BD)™), a flash memory device, amemory card, and the like.

While the present invention has been described with reference toexemplary embodiments, it is to be understood that the invention is notlimited to the disclosed exemplary embodiments. The scope of thefollowing claims is to be accorded the broadest interpretation so as toencompass all such modifications and equivalent structures andfunctions.

This application claims the benefit of Japanese Patent Application No.2014-139166, filed Jul. 4, 2014, which is hereby incorporated byreference herein in its entirety.

What is claimed is:
 1. A control method for an image processingapparatus capable of performing communication based on a wiredcommunication method, wireless communication based on a first wirelesscommunication method, and wireless communication based on a secondwireless communication method, the control method comprising: inputtinga user's instruction to activate one of the wired communication methodand the first wireless communication method using an operation screen ofthe image processing apparatus; in a case where (i) the wirelesscommunication using the second wireless communication method between theimage processing apparatus and a communication partner apparatus isexecuted, (ii) the first wireless communication method of the imageprocessing apparatus is activated by the user's instruction using theoperation screen, and (iii) the image processing apparatus is connectedto a network to which the communication partner apparatus is connectedusing the first wireless communication method, communicating data, viathe network, with the communication partner apparatus which is acommunication partner of the second wireless communication method usingthe first wireless communication method, and in a case where (i) thewireless communication using the second wireless communication methodbetween the image processing apparatus and the communication partnerapparatus is executed, (ii) the wired communication method is activatedby the user's instruction using the operation screen, and (iii) theimage processing apparatus is not connected to the network to which thecommunication partner apparatus is connected using the first wirelesscommunication method, communicating the data with the communicationpartner apparatus via a direct connection established using the firstwireless communication method between the communication partnerapparatus and the image processing apparatus, wherein the directconnection is established by the image processing apparatus performing awireless communication control processing for the direct connection. 2.The method according to claim 1, wherein the second wirelesscommunication method is Near Field Communication (NFC).
 3. The methodaccording to claim 1, wherein the second wireless communication methodis Bluetooth.
 4. The method according to claim 1, wherein the imageprocessing apparatus executes the print processing based on the datausing an inkjet printing method.
 5. The method according to claim 1,wherein a wireless communication method of the direct connection is WiFidirect.
 6. The method according to claim 1, wherein the first wirelesscommunication method is not activated in a case where the wiredcommunication method is activated by the user's instruction, and whereinthe wired communication method is not activated in a case where thefirst wireless communication method is activated by the user'sinstruction.
 7. An image processing apparatus capable of performingcommunication based on a wired communication method, wirelesscommunication based on a first wireless communication method, andwireless communication based on a second wireless communication method,the image processing apparatus comprising: an input unit that inputs auser's instruction to activate one of the wired communication method andthe first wireless communication method using an operation screen of theimage processing apparatus; and a communication control unit that (a) ina case where (i) the wireless communication using the second wirelesscommunication method between the image processing apparatus and acommunication partner apparatus is executed, (ii) the first wirelesscommunication method of the image processing apparatus is activated bythe user's instruction using the operation screen, and (iii) the imageprocessing apparatus is connected to a network to which thecommunication partner apparatus is connected using the first wirelesscommunication method, communicates data, via the network, with thecommunication partner apparatus which is a communication partner of thesecond wireless communication method using the first wirelesscommunication method, and (b) in a case where (i) the wirelesscommunication using the second wireless communication method between theimage processing apparatus and the communication partner apparatus isexecuted, (ii) the wired communication method is activated by the user'sinstruction using the operation screen, and (iii) the image processingapparatus is not connected to the network to which the communicationpartner apparatus is connected using the first wireless communicationmethod, communicates the data with the communication partner apparatusvia a direct connection established using the first wirelesscommunication method between the communication partner apparatus and theimage processing apparatus, wherein the direct connection is establishedby the image processing apparatus performing a wireless communicationcontrol processing for the direct connection.
 8. The apparatus accordingto claim 7, wherein the second wireless communication method is NearField Communication (NFC).
 9. The apparatus according to claim 7,wherein the second wireless communication method is Bluetooth.
 10. Theapparatus according to claim 7, wherein the image processing apparatusexecutes the print processing based on the data using an inkjet printingmethod.
 11. The apparatus according to claim 7, wherein a wirelesscommunication method of the direct connection is WiFi direct.
 12. Theapparatus according to claim 7, wherein the first wireless communicationmethod is not activated in a case where the wired communication methodis activated by the user's instruction, and wherein the wiredcommunication method is not activated in a case where the first wirelesscommunication method is activated by the user's instruction.